package com.example.demo.service;


import com.example.demo.bean.shopclassify;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service //将类交由spring管理
public class shopclassifyService {

    @Autowired
    private com.example.demo.Dao.shopclassifydao shopclassifydao;

    /**
     * 添加信息
     * @paramint shopid,String shopname,String shopspecis
     * @returnshopid,shopname,shopspecis
     */
    public int  Insertshopclassify(shopclassify shopclassify){ shopclassifydao.Insertshopclassify(shopclassify);
         return 1;
    }

    /**
     * 通过商品编号删除数据
     * @param
     * @return
     */
    public int Deleteshopclassify(int shopiid){
        shopclassifydao.deleteById(shopiid);
        return 1;
    }

    /**
     * 修改信息
     * @paramshopid,shopname,shopspecis
     * @returnint shopid,String shopname,String shopspecis
     */
    public int Updateshopclassify(shopclassify shopclassify) {
        shopclassifydao.updateById(shopclassify);return 1;
    }


    /**
     * 显示所有数据
     * @return
     */
    public List<shopclassify> ShowAllshopclassify() {
        return shopclassifydao.ShowAllshopclassify();
    }

    /**
     * 通过名称查询数据
     * @param number
     * @return
     */
//    public shopclassify Showshopclassify(Integer number){
//        return shopclassifydao.Showshopclassify(number);
//    }

    /**
     * 查询商品总数
     * @return
     */
    public int Totalshopclassify(){
        shopclassifydao.Totalshopclassify();
        return 1;
    };

}
